import { modal } from 'vue-strap'
import { showMsg, getBuyTypeList } from '../../../../../vuex/action.js'

export default {
  data() {
    return {
      showAddInvesterBuytypeModal: false,
      buytypeList: []
    }
  },
  methods: {
    showAddInvesterList() {
      this.xGetBuyTypeList({start: 0, limit: 99999})
      .then((res) => {
        this.buytypeList = res.data.list.map((item) => {
          item.isSelected = false
        })
        this.showAddInvesterModal = true
      }).catch((res) => {
        this.xShowMsg({
          type: 'danger',
          content: res.error_msg
        })
      })
    }
  },
  components: {
    modal: modal
  },
  vuex: {
    actions: {
      xShowMsg: showMsg,
      xGetBuyTypeList: getBuyTypeList
    }
  }
}
